package com.lh.process.engine;

import com.lh.process.engine.config.ProcessParser;
import com.lh.process.engine.context.ProcessContextFactory;
import com.lh.process.engine.context.ProcessContext;

/**
 * @author: linghao
 * @since: 2022/10/19
 */
public class ProcessEngine {

    private final ProcessContextFactory factory;

    public ProcessEngine(ProcessParser parser) throws Exception {
        this.factory = new ProcessContextFactory(parser.parse());
    }

    public ProcessContext getContext(String processName) {
        return factory.getContext(processName);
    }
}
